11. 均匀分布可视化参考答案

均匀分布可视化参考答案

```python
def plot_uniform(x_minimum, x_maximum, tick_interval):
# plot points on x-axis from 0 to 360 including the value 360
x = range(x_minimum, x_maximum + 1)
y = 1/(x_maximum - x_minimum)

plt.bar(x_minimum, y, bottom=0, width= (x_maximum - x_minimum), align='edge', alpha=0.5)
plt.xlabel('Degrees')
plt.ylabel('Probability Distribution')
plt.title('Uniform Probability Distribution')
plt.xticks(np.arange(min(x), max(x)+1, tick_interval))
plt.ylim(0, .005)

plt.show()

```